﻿using OpenAuth.Domain.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpenAuth.Domain.Interface
{
    public interface IOrganizeRepository : IRepository<Organize>
    {
        /// <summary>
        /// 分页获取类别
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        IEnumerable<Organize> LoadOrganizes(int pageindex, int pagesize);
        /// <summary>
        /// 通过IDs获取类别
        /// </summary>
        /// <param name="sortIds"></param>
        /// <returns></returns>
        IEnumerable<Organize> LoadInOrganizes(params Guid[] organizeIds);
        /// <summary>
        /// 获取类别条数
        /// </summary>
        /// <param name="organizeIds"></param>
        /// <returns></returns>
        int GetOrganizeCntInOrganizes(params Guid[] organizeIds);
        /// <summary>
        /// 分页获取类别数据（带查询条件）
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="organizeIds"></param>
        /// <returns></returns>
        IEnumerable<Organize> LoadInOrganizes(int pageindex, int pagesize, params Guid[] organizeIds);

        /// <summary>
        /// 获取当前节点的所有下级节点ID
        /// </summary>
        Guid[] GetSubIds(Guid organizeId);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        void Delete(Guid id);
    }
}
